package com.zy.project1;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.Connection;
import java.sql.SQLException;

public class App_main {
    public static void main(String[] args) throws SQLException {
        ApplicationContext ac=new AnnotationConfigApplicationContext(AppConfig.class);
        DruidDataSource ds= (DruidDataSource) ac.getBean("druidDataSource");
        System.out.println(  ds );
        Connection con=ds.getConnection();
        System.out.println( con );


        BankBizImpl bb= (BankBizImpl) ac.getBean("bankBizImpl");
        bb.showAll().forEach(  System.out::println );
    }
}
